%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Yifan Zhang
% Bejing University of Technology
% Copy Right 2023
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Computer Hough Spectrum
%
% Prepare for the circular_cross_correlation function.
% manage to compute the more accurate rotation.
%
% INPUT: 
%   HT: 它是一个参数空间矩阵，其行和列分别对应于 rho 和 theta 值。
%
% OUTPUT
%   HS: Hough Spectrum, 一维向量
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function HS = hough_spectrum(HT)
[row, col] = size(HT);


HS = zeros(1, col);

for c = 1 : col
    for r = 1 : row
        HS(c) = HS(c) + HT(r, c) * HT(r, c);
    end
end

m= max(HS);

HS = HS / m;
    
     